import { request } from '@/network/axios'
import useSWR from 'swr'
import { getCanvasData, LoginParams } from './api-params-moudle'
import { GetCityTotal, ServerStats } from './api-res-model'

/** 这里枚举定义所有接口 */
enum APIS {
  GET_CITY_TOTAL_NUMBER = '/xxxx/xxxx/xxxxx',
}

/** 一个示例 */
export const getCityTotalNumber = (params: getCanvasData) =>
  request.get<GetCityTotal>(APIS.GET_CITY_TOTAL_NUMBER, params)

export const getClientGrouped = () =>
  useSWR('/api/client/grouped', (url) => request.get<any>(url))
export const Login = (params: LoginParams) =>
  request.get('/sanctum/csrf-cookie')
    .then(() =>
      request.post('/auth/login', params)
    )

